- can_create_subgroups = can?(current_user, :create_subgroup, @group)
- can_create_projects = can?(current_user, :create_projects, @group)
- emails_disabled = @group.emails_disabled?

.group-home-panel

  - unless @group.subgroup?
    = render_if_exists 'shared/targeted_message_banner', group: @group

  .gl-flex.gl-justify-between.gl-flex-wrap.gl-flex-col.gl-gap-3.gl-my-5{ class: "@sm/panel:gl-flex-row" }
    .home-panel-title-row.gl-flex
      = render Pajamas::AvatarComponent.new(@group, size: 48, class: 'float-none gl-self-start gl-shrink-0 gl-mr-3', avatar_options: { itemprop: 'logo' })
      %h1.home-panel-title.gl-heading-1.gl-flex.gl-items-center.gl-flex-wrap.gl-gap-3.gl-break-anywhere.gl-mb-0{ itemprop: 'name' }
        = @group.name
        %span.visibility-icon.gl-text-subtle.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@group) }
          = visibility_level_icon(@group.visibility_level, options: { class: 'icon' })
        = render_if_exists 'shared/tier_badge', source: @group
        = render 'shared/groups/badges', group: @group

    - if current_user
      .home-panel-buttons.gl-flex.gl-items-center.gl-gap-3{ class: "@md/panel:gl-justify-end", data: { testid: 'group-buttons' } }
        - if current_user.admin?
          = render Pajamas::ButtonComponent.new(href: [:admin, @group], icon: 'admin', button_options: { title: _('View group in admin area'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } })
        - if @notification_setting
          .js-vue-notification-dropdown{ data: { disabled: emails_disabled.to_s, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications.md'), group_id: @group.id, container_class: 'gl-align-top' } }
        - if can_create_subgroups
          = render Pajamas::ButtonComponent.new(href: new_group_path(parent_id: @group.id, anchor: 'create-group-pane'), button_options: { data: { testid: 'new-subgroup-button' } }) do
            = _("Create subgroup")

        - if can_create_projects
          = render Pajamas::ButtonComponent.new(href: new_project_path(namespace_id: @group.id), variant: :confirm, button_options: { data: { testid: 'new-project-button' } }) do
            = _('Create project')

        = render 'groups/more_actions_dropdown', source: @group

  - if @group.description.present?
    .group-home-desc.gl-mt-2
      .home-panel-description.gl-text-subtle.gl-break-words
        .home-panel-description-markdown.read-more-container{ itemprop: 'description' }
          = markdown_field(@group.namespace_details, :description)
        = render Pajamas::ButtonComponent.new(variant: :link, button_options: { class: 'js-read-more-trigger @lg/panel:gl-hidden' }) do
          = _("Read more")
